'use strict';
module.exports = (request, response, rfun)=>{
    if(!response.headersSent){
        //response.setHeader("Content-Type", "text/html;charset=UTF-8");
        response.setHeader("Content-Type", "application/json");
		response.setHeader("Access-Control-Allow-Origin", "*");
	} 
    if(response.DATA)
    {
        if(typeof response.DATA == "object") response.DATA = JSON.stringify(response.DATA);
        response.end(response.DATA);
    }
    else
        response.end();
    rfun();
}